#pragma once
#include "pch.h"
#include "resource.h"

namespace D11
{
	struct WinApp
	{
		HINSTANCE               g_hInst = nullptr;
		HWND                    g_hWnd = nullptr;
		D3D_DRIVER_TYPE         g_driverType = D3D_DRIVER_TYPE_NULL;
		D3D_FEATURE_LEVEL       g_featureLevel = D3D_FEATURE_LEVEL_11_0;
		ID3D11Device* g_pd3dDevice = nullptr;
		ID3D11Device1* g_pd3dDevice1 = nullptr;
		ID3D11DeviceContext* g_pImmediateContext = nullptr;
		ID3D11DeviceContext1* g_pImmediateContext1 = nullptr;
		IDXGISwapChain* g_pSwapChain = nullptr;
		IDXGISwapChain1* g_pSwapChain1 = nullptr;
		ID3D11RenderTargetView* g_pRenderTargetView = nullptr;

		struct State
		{
			int width = 800;
			int height = 600;
			LPCWSTR title = L"DirectX ";

		} m_State;
	public:
		WinApp(const State& state);

		HRESULT InitWindow(HINSTANCE hInstance, int nCmdShow);
		HRESULT InitDevice();
		void CleanupDevice();

		virtual int Execute();
		virtual void OnFrameRender();
		virtual bool InitD3DApp(HINSTANCE hInstance, int nCmdShow);

		
	};
};

